define(["core/boilerplate", "core/manager", "playerWithGamepad", "conf/player"], 
	function(Boilerplate, Manager, PlayerWithGamepad, Conf) {
		var PlayerWithGamepadManager = new Manager(PlayerWithGamepad);

		// Call after initialization
		PlayerWithGamepadManager.caInit = function() {
			for(var iE = 0, cE = this.entities.length; iE < cE; iE++) {
				var entity = this.entities[iE];
				if(typeof entity != 'undefined') {
					entity.controller = Boilerplate.getManager('Gamepad').entities[iE];
					entity.color = Conf.colors[iE];
				}
			}
		}

		return PlayerWithGamepadManager;
	}
);